package com.wude.guild;

import android.os.Bundle;
import android.text.TextUtils;

import com.umeng.analytics.MobclickAgent;
import com.wude.guild.fragment.AboutUsFragment;
import com.wude.guild.fragment.AdviseFragment;
import com.wude.guild.fragment.BangbiFragment;
import com.wude.guild.fragment.EditFragment;
import com.wude.guild.fragment.JifenDetailFragment;
import com.wude.guild.fragment.MyCollectionFragment;
import com.wude.guild.fragment.MyCommentFragment;
import com.wude.guild.fragment.MyGameFragment;
import com.wude.guild.fragment.MyGiftFragment;
import com.wude.guild.fragment.MyTrafficFragment;
import com.wude.guild.fragment.SettingFragment;
import com.wude.guild.servercore.mints.MintsBaseActivity;

import java.text.BreakIterator;

public class MineManagerActivity extends MintsBaseActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_mine_manager);

        initFragment(getIntent().getStringExtra("fragmentName"));
    }

    private void initFragment(String name) {
        if (TextUtils.isEmpty(name)) {
            finish();
            return;
        }
        switch (name) {
            case "BangbiFragment"://绑币管理
                pushFragmentToBackStack(BangbiFragment.class, null);
                break;
            case "MyGiftFragment"://我的礼包
                pushFragmentToBackStack(MyGiftFragment.class, null);
                break;
            case "MyGameFragment"://我的游戏
                pushFragmentToBackStack(MyGameFragment.class, null);
                break;
            case "MyCollectionFragment"://我的收藏
                pushFragmentToBackStack(MyCollectionFragment.class, null);
                break;
            case "MyCommentFragment"://我的评论
                pushFragmentToBackStack(MyCommentFragment.class, null);
                break;
            case "AdviseFragment"://问题与建议
                pushFragmentToBackStack(AdviseFragment.class, null);
                break;
            case "AboutUsFragment"://关于我们
                pushFragmentToBackStack(AboutUsFragment.class, null);
                break;
            case "EditFragment"://编辑信息
                pushFragmentToBackStack(EditFragment.class, null);
                break;
            case "SettingFragment"://设置
                pushFragmentToBackStack(SettingFragment.class, null);
                break;
            case "MyTrafficFragment"://我的流量
                pushFragmentToBackStack(MyTrafficFragment.class, null);
                break;
            case "JifenDetailFragment"://我的积分
                pushFragmentToBackStack(JifenDetailFragment.class, null);
                break;

        }
    }

    @Override
    protected void onResume() {
        super.onResume();
        MobclickAgent.onResume(this);
    }

    @Override
    protected void onPause() {
        super.onPause();
        MobclickAgent.onPause(this);
    }

    @Override
    protected int getFragmentContainerId() {
        return R.id.container;
    }
}
